package com.itheima.service.imp;

import com.itheima.dao.StudentDao;
import com.itheima.dao.imp.StudentDaoImpl;
import com.itheima.domain.Student;
import com.itheima.service.StudentService;

import java.util.List;

/**
 * 学生的业务层实现类
 * @author 黑马程序员
 * @Company http://www.itheima.com
 */
public class StudentServiceImpl implements StudentService {

    private StudentDao studentDao = new StudentDaoImpl();

    @Override
    public List<Student> findAll() {
        return studentDao.findAll();
    }

    @Override
    public Student findById(Integer sid) {
        return studentDao.findById(sid);
    }

    @Override
    public int save(Student student) {
        //保存
       return studentDao.insert(student);
    }

    @Override
    public int update(Student student) {
        return studentDao.update(student);
    }

    @Override
    public int delete(Integer sid) {

        return studentDao.delete(sid);
    }
}
